.TH std::any::operator= 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::any::operator= \- std::any::operator=

.SH Synopsis
   any& operator=( const any& rhs );      \fB(1)\fP \fI(since C++17)\fP
   any& operator=( any&& rhs ) noexcept;  \fB(2)\fP \fI(since C++17)\fP
   template< typename ValueType >         \fB(3)\fP \fI(since C++17)\fP
       any& operator=( ValueType&& rhs );

   Assigns contents to the contained value.

   1) Assigns by copying the state of rhs, as if by any(rhs).swap(*this).
   2) Assigns by moving the state of rhs, as if by any(std::move(rhs)).swap(*this). rhs
   is left in a valid but unspecified state after the assignment.
   3) Assigns the type and value of rhs, as if by
   any(std::forward<ValueType>(rhs)).swap(*this). This overload participates in
   overload resolution only if std::decay_t<ValueType> is not the same type as any and
   std::is_copy_constructible_v<std::decay_t<ValueType>> is true.

.SH Template parameters

   ValueType               -              contained value type
.SH Type requirements
   -
   std::decay_t<ValueType> must meet the requirements of CopyConstructible.

.SH Parameters

   rhs - object whose contained value to assign

.SH Return value

   *this

.SH Exceptions

   1,3) Throws std::bad_alloc or any exception thrown by the constructor of the
   contained type. If an exception is thrown, there are no effects (strong exception
   guarantee).

.SH Example

    This section is incomplete
    Reason: no example

.SH See also

   constructor   constructs an any object
                 \fI(public member function)\fP

.SH Category:
     * Todo no example
